<?php
require_once '../global.php';
function king_def(){
	global $king;
	include_once('./library/Taoapi.php');
	include_once('./inc/fun.php');
	
	
	

	

		$cachepath="taobaoapi/lanmu";
		if(!$blockto=$king->cache->get($cachepath)){
		
			$a=taobao_itemcats_get(50008779);
			$blockto['50008779']=$a[item_cats][item_cat];	
				

						if(empty($blockto['50008779'])){//如果为空则写入缓存
							$king->cache->put($cachepath,$lanmu);
						}
		}			
	
		//print_r($blockto);
	
	
	
	
	
	

}



function king_view(){
	global $king;
	
	include_once('./inc/fun.php');
	require_once 'class_ciji.php';/*必须的*/
	require_once 'Snoopy.class.php';/*必须的*/

	$url = 'http://love.taobao.com/guang/async_item_tag_search.htm?_input_charset=utf-8&tags=%E7%A2%8E%E8%8A%B1+%E8%8E%AB%E4%BB%A3%E5%B0%94+%E7%94%B0%E5%9B%AD&category=50008779&t=1347771988245&page=1';
	$spider  = new spider();
	$spider->kuiurl = $url;

	$spider->getContent();
	$spider->kuibody=array('{"avatarIds":','"totalPage":0}');

	$str=$spider->getbody();

	$str = stripslashes('{"avatarIds":'.$str.'"totalPage":0}');

	echo $str;

$decodedArray = json_decode($str, true);  
print_r($decodedArray);  
	

}

　
?>